Use *args inside FAIL and SKIP so that it is possible to call these functions
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 23 Mar 2006 13:34:35 +0000 (14:34 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 23 Mar 2006 13:34:35 +0000 (14:34 +0100)
with multiple arguments, printf style.  This is already being done in some
cases (causing an exception of course).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/xm-test/lib/XmTestLib/Test.py

index 32d1574eae9989a7cb70d56e4b0714d0b12173ea..ee49ccd35830d9ac9a1cbee54d409a45004853e6 100644 (file)
@@ -131,12 +131,12 @@ def becomeNonRoot():
         if os.geteuid() == 0:
             FAIL("Could not become a non-root user")
 
-def FAIL(reason):
-    print "\nREASON: %s" % reason
+def FAIL(format, *args):
+    print "\nREASON:", (format % args)
     sys.exit(TEST_FAIL)
 
-def SKIP(reason):
-    print "\nREASON: %s" % reason
+def SKIP(format, *args):
+    print "\nREASON:", (format % args)
     sys.exit(TEST_SKIP)
 
 def saveLog(logText, filename=None):